package com.ykw.parking.controller;

import com.ykw.parking.Utils.RandomId;
import com.ykw.parking.mapper.SellParkingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class SellparkingController {
    @Autowired
    SellParkingMapper parkingMapper;
    @RequestMapping(value = "/getParking",method=RequestMethod.POST)
    @ResponseBody
    public String getparking(String city,String address,String parking,
                             String price ,String owner_name,String owner_phone){
        String id= RandomId.getRandomNumberByNum(16);
        System.out.println(id+city+address+parking+price+owner_name+owner_phone);
        parkingMapper.insertParking(id,city+address,price,owner_name,owner_phone,parking);
        String msg;
        msg="添加成功";
        return msg;
    }
}
